<template>
	<view class="record-page">
		<u-navbar :autoBack="true" title="提现记录" :placeholder="true" bgColor="rgba(255,255,255,0)"></u-navbar>
		<view class="recharge-item" v-for="(item,index) in list" :key="index">
			<view class="recharge-left">
				<view class="">
					<image src="https://m.lqvvvv.com/assets/static/my/recharge.png" mode=""></image>
				</view>
				<view class="recharge-info">
					<view class="info-text1" v-if="item.status == 'created'">
						审核中
					</view>
					<view class="info-text2" v-if="item.status == 'successed'">
						提现成功
					</view>
					<view class="info-text3" v-if="item.status == 'rejected'">
						提现失败
					</view>
					<view class="info-time">
						{{$u.timeFormat(item.createtime, 'yyyy年mm月dd日 hh:MM:ss')}}
					</view>
				</view>
			</view>
			<view class="price1" v-if="item.status == 'created'">
				{{item.money}}
			</view>
			<view class="price2" v-if="item.status == 'successed'">
				{{item.money}}
			</view>
			<view class="price3" v-if="item.status == 'rejected'">
				{{item.money}}
			</view>
		</view>
		<u-loadmore :status="status" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				page: 1,
				status: 'loadmore',
			}
		},
		onLoad() {
			this.postlist()
		},
		onReachBottom() {
			this.page = this.page + 1
			this.status = 'loading';
			this.postlist()
		},
		methods: {
			postlist() {
				let params = {
					page: this.page,
					limit: 10
				}
				this.$Request({
					method: 'POST',
					url: '/api/withdraw/withdrawlog',
					data: params,
					ismsg: false,
				}).then(res => {
					if (res.code == 1) {
						if (res.data.data.length < 10) {
							this.status = 'nomore';
						}
						if (this.page == 1) {
							this.list = res.data.data
						} else {
							this.list = [...this.list, ...res.data.data]
						}

					}
				})
			},
		}
	}
</script>

<style scoped lang="scss">
	.record-page {
		min-height: 100vh;
		background-image: url('https://m.lqvvvv.com/assets/static/index/nav-bg.png');
		background-repeat: no-repeat;
		background-size: 100% 800rpx;
		padding: 30rpx;

		.recharge-item {
			padding: 20rpx 30rpx;
			background-color: #ffffff;
			border-radius: 30rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-bottom: 30rpx;

			.recharge-left {
				width: 70%;
				display: flex;
				align-items: center;

				image {
					width: 50rpx;
					height: 50rpx;
				}

				.recharge-info {
					margin-left: 30rpx;

					.info-text1 {
						color: #000000;
						font-size: 28rpx;
						font-weight: 600;
					}

					.info-text2 {
						color: #00d800;
						font-size: 28rpx;
						font-weight: 600;
					}

					.info-text3 {
						color: #ff0000;
						font-size: 28rpx;
						font-weight: 600;
					}

					.info-time {
						color: #9799AC;
						font-size: 24rpx;
						margin-top: 10rpx;
					}
				}
			}

			.price1 {
				color: #5755F2;
				font-size: 36rpx;
				font-weight: bold;
			}

			.price2 {
				color: #00d800;
				font-size: 36rpx;
				font-weight: bold;
			}

			.price3 {
				color: #ff0000;
				font-size: 36rpx;
				font-weight: bold;
			}

			.withdrawal {
				color: #FF4C4F;
			}
		}
	}
</style>